Skip to content

Develop#1

Open
EvaV21 wants to merge 7 commits intomainfrom
develop
Open

Develop#1
EvaV21 wants to merge 7 commits intomainfrom
develop

Conversation

@EvaV21
Copy link
Owner

@EvaV21 EvaV21 commented Feb 25, 2026

No description provided.


class DzenPage(BasePage):
def switch_to_new_tab(self):
self.driver.switch_to.window(self.driver.window_handles[-1]) No newline at end of file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: здесь и далее по проекту: все прямые обращения к driver необходимо вынести в basePage и оттуда за счет наследования переиспользовать в объектах страниц



class MainPage(BasePage):
ORDER_TOP = (By.CSS_SELECTOR, "button.Button_Button__ra12g")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: Разместить локаторы в отдельную папку, структура папки и файлов будет совпадать с структурой page objects - то есть у каждого файла с РО будет соответствующий файл с локаторами.

el = self.wait.until(EC.presence_of_element_located(locator))
self.driver.execute_script("arguments[0].click();", el)

def _safe_click(self, locator):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

похоже это должно быть на уровне basePage

options = self.wait.until(EC.visibility_of_all_elements_located(self.RENT_OPTIONS))
options[0].click()

if data["color"] == "black":
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: условий в тестах быть не может, тест всегда однозначен. Если это не вписывается в параметризацию, значит ее быть не должно и это просто несколько отдельных тестовых методов

from pages.main_page import MainPage
from data.urls import BASE_URL

DZEN_REDIRECT_URL = "https://dzen.ru/?yredirect=true"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно исправить: всегда получать урлы из констант

@pytest.mark.navigation
class TestNavigation:

def test_click_scooter_logo_opens_main(self, driver, wait):

This comment was marked as resolved.

main.click_scooter_logo()

wait.until(EC.url_to_be(BASE_URL))
assert driver.current_url == BASE_URL
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: здесь и далее: прямого обращения к driver и wait из тестов быть не должно , только через методы пейджей


driver.get(DZEN_REDIRECT_URL)
long_wait.until(lambda d: "dzen.ru" in d.current_url)
assert "dzen.ru" in driver.current_url No newline at end of file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно использовать урлы из констант

main.open(BASE_URL)
main.accept_cookies_if_present()

if entry == "top":
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: условий в тестах быть не может, тест всегда однозначен. Если это не вписывается в параметризацию, значит ее быть не должно и это просто несколько отдельных тестовых методов



@pytest.fixture
def wait(driver):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно удалить, это не фикстура и предусловие

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

отлично: появилась папка с локаторами

@allure.step("Проверить успешное оформление заказа")
def assert_success(self):
self.is_visible(L.SUCCESS_MODAL)
self.is_visible(L.SUCCESS_TEXT) No newline at end of file
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отлично: в пейджах отдельные действия собраны в полноценные тестовые шаги, это сделает код тестов более понятным

(4, "Пока что нет"),
(5, "Самокат приезжает к вам"),
(6, "Штрафа не будет"),
(7, "Московской области"),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно исправить: в файле с тестами должны быть только тесты, все тестовые данные нужно хранить во внешних модулях и импортировать

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants